<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	SiteForm form = (SiteForm)request.getAttribute("command");
	String module = form.getModule();
	String name = form.getName();
	String alias = "";
	String content = "";
	String contentEn = "";
	String contentBig5 = "";
	if (Constants.SITE_MODULE_PRODUCT.equalsIgnoreCase(module)) {
		TblSiteProduct product = (TblSiteProduct)request.getAttribute("product");
		content = StringUtils.isNotBlank(product.getDescribe())?product.getDescribe():content;
		contentEn = StringUtils.isNotBlank(product.getDescribeEn())?product.getDescribeEn():contentEn;
		contentBig5 = StringUtils.isNotBlank(product.getDescribeBig5())?product.getDescribeBig5():contentBig5;
		alias = product.getName();
	}
	if (Constants.SITE_MODULE_CUSTOM.equalsIgnoreCase(module)) {
		TblSiteCompany company = (TblSiteCompany)request.getAttribute("company");
		contentEn = StringUtils.isNotBlank(company.getContentEn())?company.getContentEn():contentEn;
		contentBig5 = StringUtils.isNotBlank(company.getContentBig5())?company.getContentBig5():contentBig5;
		content = StringUtils.isNotBlank(company.getContent())?company.getContent():content;
		alias = company.getName();
	}
	String tab = form.getTab();
%>





<div>
	<form action="<%=request.getContextPath()%>/site/doEdit" target="_coreIframe" method="post" enctype="multipart/form-data">
		<input type="hidden" name="module" value="<%=module%>">
		<input type="hidden" name="name" value="<%=name%>">
		<table class="formTable">
			<tr>
				<td class="tdTitle">模块:</td>
				<td><%=alias%></td>
			</tr>
			<tr>
				<td class="tdTitle">中文内容:</td>
				<td>
					<div class="checkbox-wrap">
					<textarea name="content" id="moduleContentEdit" style="width: 700px; height: 400px; visibility: hidden;">
						<%=content %>
					</textarea>
					</div>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">英文内容:</td>
				<td>
					<div class="checkbox-wrap">
					<textarea name="contentEn" id="moduleContentEnEdit" style="width: 700px; height: 400px; visibility: hidden;">
						<%=contentEn %>
					</textarea>
					</div>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">繁体内容:</td>
				<td>
					<div class="checkbox-wrap">
					<textarea name="contentBig5" id="moduleContentBig5Edit" style="width: 700px; height: 400px; visibility: hidden;">
						<%=contentBig5 %>
					</textarea>
					</div>
				</td>
			</tr>							
			<tr>
				<td class="tdTitle"></td>
				<td>
					<div>
						<input class="input-btn-microsoft" type="submit" value="提交">
					</div>
				</td>
			</tr>	
		</table>
	</form>
	<iframe id="_coreIframe" name="_coreIframe" style="display: none;"></iframe>
</div>






















<%-- <div>
	<form action="<%=request.getContextPath()%>/site/doEdit" target="_coreIframe">
		<input type="hidden" name="module" value="<%=module%>">
		<input type="hidden" name="name" value="<%=name%>">
		<div>
			<ul>
				<li>
					<label>模块：</label>
					<span><%=alias %></span>
				</li>
				<li>
					<label>内容：</label>
					<textarea name="content" id="moduleContentEdit" style="width: 740px; height: 300px; visibility: hidden;">
						<%=content %>
					</textarea>
				</li>
				<li>
					<input class="input-btn-microsoft" type="submit" value="提交">
					<input class="input-btn-microsoft" type="submit" value="取消">
				</li>
			</ul>
		</div>
	</form>
	<iframe id="_coreIframe" name="_coreIframe" style="display: none;"></iframe>
</div> --%>

<script type="text/javascript">
	/* 	var editor;
		KindEditor.ready(function(K) {
			editor = K.create('textarea[name="moduleContentEdit"]', {
				allowFileManager : true,
			
				items : [
				 		'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
				 		'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
				 		'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
				 		'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
				 		'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
				 		'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
				 		'flash', 'media','|', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
				 		'anchor', 'link', 'unlink'
				 	]
			});
		}); */

</script>
<script type="text/javascript">
	$(function(){
		XF.createKindEditor("moduleContentEdit");
		XF.createKindEditor("moduleContentEnEdit");
		XF.createKindEditor("moduleContentBig5Edit");
		$("textarea[name=module]").focus();
	});
</script>
</html>